package com.geek.java.ch02;

import java.util.Scanner;

public class IFTest1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入第一个数字: ");
        int a = sc.nextInt();

        System.out.println("请输入第二个数字：");
        int b = sc.nextInt();

        System.out.println("请输入运算符：");
        String c = sc.next();

        if (c.equals("+")){
            System.out.println("结果："+(a + b));
        }
        else if (c.equals("-")){
            System.out.println("结果："+(a - b));
        }
        else if (c.equals("*")){
            System.out.println("结果："+(a * b));
        }
        else if (c.equals("/")){
            System.out.println("结果："+(a / b));
        }
    }
}
